<!-- 设备误报 -->
<template>
	<view class="page">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block style="color: ##777777;font-size: 48rpx;" slot="content">设备误报</block>
		</cu-custom>
		<view class="content">
			<ul>
				<li>
					<text>设备名称：{{sbmc}}</text>
				</li>
				<li>
					<text>企业名称：{{qymc}}</text>
				</li>
				<li>
					<text>所在位置：{{szwz}}</text>
				</li>
				<li>
					<text>所在区域：{{szqy}}</text>
				</li>
			</ul>
		</view>

		<view class="flex btns-group">
			<button class="my-btn-grpup" @click="jswb">结束误报</button>
			<button class="my-btn-grpup" @click="scgd">隐患上报</button>
		</view>

	</view>
</template>

<script>
	export default {
		onLoad(option) {
			this.equipmentId = option.equipmentId
			this.ucId = option.ucId
			this.xq()
		},
		data() {
			return {
				equipmentId: '',
				ucId: '',
				sbmc: '',
				qymc: '',
				szwz: '',
				szqy: ''
			}
		},
		methods: {
			jswb() {
				let that = this
				let params = {
					ucId: that.ucId,
					feedtype: 0,
					feedback: "设备误报",
					fileUrl: ''
				}
				// 请求数据
				let app = getApp()
				app.globalData.request({
					url: 'wx/fireAlarmInfo/updateInFireAlarmInfo',
					data: {
						...params
					}
				}).then(function(res) {
					console.info(res)
					if (res.data.code == 0) {
						uni.showToast({
							title: "结束误报成功",
							icon: 'success'
						})
						uni.navigateBack({
							delta: 2
						})
					}

				}).catch(function(e) {

				})
			},
			scgd() {
				uni.navigateTo({
					url: '/yzqy/yhgd/yhgd?ucId=' + this.ucId
				});
			},
			xq() {
				// 封装参数
				let that = this
				let params = {
					"ucId": that.equipmentId
				}
				// 请求数据
				let app = getApp()
				app.globalData.request({
					url: 'wx/firealarm/getInEquipmentVo',
					data: {
						...params
					}
				}).then(function(res) {
					console.info(res)
					that.sbmc = res.data.data.disPlayName
					that.qymc = res.data.data.enterpriseName
					that.szwz = res.data.data.address
					that.szqy = res.data.data.regionName

				}).catch(function(e) {

				})
			}
		}
	}
</script>

<style scoped>
	page {
		width: 100vw;
		position: relative;
	}

	.content {
		margin-top: 24rpx;
		background-color: #FFFFFF;
	}

	li {
		height: 94rpx;
		margin-left: 24rpx;
		margin-right: 24rpx;
		position: relative;
	}


	li text {
		font-size: 24rpx;
		color: #777777;
		letter-spacing: 0.39px;
		line-height: 94rpx;
	}

	li::after {
		content: ''; // 必须
		position: absolute;
		left: 2rpx;
		bottom: 0;
		right: 2rpx;
		height: 1px;
		background-color: #dcdcdc;
	}

	.my-btn {
		height: 94rpx;
		background-image: linear-gradient(90deg, #FAB53A 4%, #EFA21A 99%);
		box-shadow: 0 0 12px 0 rgba(250, 181, 58, 0.50);
		border-radius: 24px;
		ont-family: PingFangSC-Medium;
		color: #FFFFFF;
		letter-spacing: 0;
		text-align: center;
	}

	.my-btn-grpup {
		height: 160rpx;
		line-height: 160rpx;
		vertical-align: middle;
		text-align: center;
	}

	.btns-group {
		width: 100%;
		position: absolute;
		bottom: 0;
		text-align: center;
		display: flex;
		flex-direction: row;
		align-items: flex-end;
	}

	.btns-group button:first-child {
		background-color: #458DF5;
		color: #FFFFFF;
		flex: 1;
		font-size: 36rpx;
		outline: none;
		border: none;
		margin: 0;
		padding: 0;
		border: 1px solid transparent;
		border-radius: 0;
		border-top-left-radius: 16px;
	}

	.btns-group button:nth-child(2) {
		background-color: #54BE7A;
		color: #FFFFFF;
		flex: 1;
		font-size: 36rpx;
		outline: none;
		border: none;
		margin: 0;
		padding: 0;
		border: 1px solid transparent;
		border-radius: 0;
	}

	.btns-group button:last-child {
		background-color: #FABD50;
		flex: 1;
		color: #FFFFFF;
		font-size: 36rpx;
		outline: none;
		border: none;
		margin: 0;
		padding: 0;
		border: 1px solid transparent;
		border-radius: 0;
		border-top-right-radius: 16px;
	}

	.my-flag {
		position: relative;
	}

	.action::before {
		position: absolute;
		left: 18rpx;
		width: 6rpx;
		height: 32rpx;
		content: '';
		background: #FAB539;

	}
</style>
